//
//  CMDBDynamicBean.swift
//  CMDB
//
//  Created by 王磊 on 17/4/7.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

public class CMDBDynamicBean: NSObject {
    
    var tid: String = ""
    
    var user: CMDBUserInfoBean? /* 用户 */
    
    var type: String = ""
    
    var title: String = "" /* 标题 */
    
    var createTime: String = "" /* 时间戳 */
    
    var createTimeFormat : String = "" //显示时间
    
    var content: String = "" /* 内容 */
    
    var imgs: String = "" /* 图片的url 数组 */
    
    var comments: Array<CMDBCommentBean>?
    
    var likeUsers : Array<CMDBLikeUserBean>?
    
    var isLike: String = ""
    
    var likeCount: String = ""
    
    var like: Bool {
        
        return isLike == "1" ? true : false
    }
    var isCollect: String = ""
    
    var favorCount: String = ""
    
    var collect: Bool {
        
        return isCollect == "1" ? true : false
    }
    
    var shareCount: String = ""
    
    var commentCount: String = ""
    
    var cellHeight : CGFloat = 0
    
}
extension CMDBDynamicBean: DictModelProtocol{
    
    public static func customClassMapping() -> [String : String]? {
        
        return ["comments":"CMDBCommentBean","likeUsers":"CMDBLikeUserBean"]
    }
    
}